package com.cqc.jdk8.Jtime;

import org.junit.Test;

import java.text.SimpleDateFormat;
import java.util.Date;

public class SimpleDateFormatTest {

    @Test
    public void f1() {
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Date date = new Date();
        date.setHours(0);
        date.setMinutes(0);
        date.setSeconds(0);
        //2024-04-09 00:00:00
        System.out.println(format.format(date));

        date.setHours(23);
        date.setMinutes(59);
        date.setSeconds(59);
        //2024-04-09 23:59:59
        System.out.println(format.format(date));
    }
}
